package se.haaga.jsupervision.util;

/**
 * Translation for the program.
 * @author Richard Haaga
 *
 */
public enum Translator {
	
	MAIN_PROGRAM_TITLE, ABOUT_MESSAGE, VERSION, ABOUT,
	TAB_WELCOME, EXIT_CONFIRM_MESSAGE, EXIT_CONFIRM_TITLE,
	MENU_FILE, MENU_FILE_EXIT, 
	MENU_WINDOWS, MENU_WINDOWS_CLOSETAB,
	MENU_MONITORS, MENU_MONITORS_LINUX, MENU_MONITORS_LINUX_NEW_CONNECTION,
	MONITOR_LINUX_MEMORY_TITLE, MONITOR_LINUX_CPU_TITLE, MONITOR_LINUX_SYSINFO_TITLE, MONITOR_LINUX_DRIVE_TITLE,
	MONITOR_LINUX_SYSINFO_ID, MONITOR_LINUX_SYSINFO_RELEASE, MONITOR_LINUX_SYSINFO_CODENAME,
	MONITOR_LINUX_SYSINFO_DESCRIPTION, MONITOR_LINUX_SYSINFO_KERNEL_VERSION, MONITOR_LINUX_SYSINFO_UPTIME,
	MENU_HELP, MENU_HELP_ABOUT;

	private PropertiesReader propertiesReader = PropertiesReader.getInstance();
	
	public String getTranslation() {
		StringBuilder sb = new StringBuilder();
		sb.append(propertiesReader.getSelectLanguage());
		sb.append(".");
		sb.append(transformEnum());
		return propertiesReader.getLanguageTranslation(sb.toString());
	}
	
	private String transformEnum() {
		String temp = this.toString();
		temp = temp.toLowerCase();
		temp = temp.replaceAll("_", ".");
		return temp;
	}

}
